<?php

namespace Biz\service\wiki;

use Biz\model\wiki\TaoBaoOrders as mTaoBaoOrders;

class TaoBaoOrders
{
    const DEFAULT_FIELD =[
        'pay_price' ,
        'total_commission_rate' ,
        'total_commission_fee' ,
        'tb_paid_time',
        'tk_paid_time' ,
        'tk_earning_time' ,
        'item_id' ,
        'item_price',
        'item_title',
        'item_img',
        'item_link',
        'trade_id',
        'tk_status',
        'relation_id',
    ];

    /*获取 订单信息
     *@params string adzone_id
     *@return array  result
     * */
    public static function getOrdersByAdzoneId($adzone_id )
    {
        if(empty($adzone_id)) return [];
        $info =   mTaoBaoOrders::selectByWhere(
            [
                'adzone_id' => $adzone_id  ,
                'OR' => [
                    'addtime[>=]' => date("Y-m-d" , strtotime("-1 day")),
                    'edittime[>=]' => date("Y-m-d" , strtotime("-1 day")),
                ],
            ] ,self::DEFAULT_FIELD);
        return $info;
    }





}
